<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>Title</title>
</head>
<body>
    <div id="root">
      <input type="text">
      <div></div>
    </div>
</body>
<script>
    const root = document.querySelector("#root");
    const input = root.querySelector("input");
    const div = root.querySelector("div");
    let str = "一年有365天";
    input.oninput = function(){
        str = div.innerHTML = this.value;
    }
    div.innerHTML = input.value = str;
</script>
</html>